import React from 'react';
import { Form, Row, DatePicker, Button, Select, Input, Col, Radio, Card } from 'antd';
const FormItem = Form.Item;
const { Option } = Select;
const { RangePicker } = DatePicker

const InfoForm = ({ form: { getFieldDecorator, getFieldsValue }, isEdit, searchItem, titleStyle, title }) => {

    return (
        <Card title={<div style={titleStyle}>{title}</div>} bordered={false}>
            <Form layout='vertical'>
                <Row gutter={16}>
                    <Col span={8}>
                        <FormItem label="机型">
                            {getFieldDecorator('model', {
                                initialValue: searchItem.model || ''
                            })(
                                <Input placeholder='请输入机型' allowClear disabled={!isEdit} />
                            )}
                        </FormItem>
                    </Col>
                    <Col span={8}>
                        <FormItem label="批号">
                            {getFieldDecorator('batchNo', {
                                initialValue: searchItem.batchNo || ''
                            })(
                                <Input placeholder='请输入批号' allowClear disabled={!isEdit} />
                            )}
                        </FormItem>
                    </Col>
                    <Col span={8}>
                        <FormItem label="类型">
                            {getFieldDecorator('isStatus', {
                                initialValue: searchItem.isStatus || 2
                            })(
                                <Radio.Group disabled={!isEdit}>
                                    <Radio value={1}>厂外</Radio>
                                    <Radio value={2}>厂内</Radio>
                                </Radio.Group>
                            )}
                        </FormItem>
                    </Col>
                </Row>
            </Form>
        </Card>
    );
};

export default Form.create()(InfoForm);
